Finishing up

Before the end of the program, always call plend to close any output plot file and to free up any memory that may have been allocated. For devices that have separate graphics and text modes, plend always resets the device into text mode. If it is required to switch between modes within a program, the functions plgra and pltext set the device to graphics and text modes respectively.